home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
gnu
/
smaltalk.lha
/
smalltalk-1.1.1
/
print_file_names
< prev
next >
Wrap
Text File
|
1991-09-12
|
608b
|
34 lines
#!/bin/sh
# Usage:
# print_file_names [ -d dir ] file_or_dir [ file_or_dir ... ]
#
# Prints out each of the file names given by its argument. If the
# file turns out to be a directory, the contents of that directory
# are printed. The -d flag says "print the file names relative to <dir>"
# instead of relative to the current directory. Symbolic links
# are suppressed.
if [ "$1" = "-d" ]
then
cd $2
shift 2
fi
for file
do
if [ ! -h ${file} ]
then # suppress symbolic links
echo ${file}
if [ -d ${file} ]
then # recurse
print_file_names `/bin/ls -d ${file}/*`
fi
fi
done